/*
 * @Author: zxc
 * @Date: 2020-08-20 16:39:22
 * @LastEditTime: 2020-09-08 12:02:14
 * @LastEditors: zxc
 * @Description: 路由
 */
import React from 'react';
import Loadable from 'react-loadable';
import RouteWithSubRouters from '../RouteWithSubRouters';
import loadings from '../loadings';

import {
  UnderlineOutlined,
  FontSizeOutlined,
  BgColorsOutlined,
  SmallDashOutlined,
  PieChartOutlined,
} from '@ant-design/icons';


const blog = [
  {
    component: Loadable({
      loader:() => import("../../pages/blog-manage/tag"),
      ...loadings
    }),
    icon: <UnderlineOutlined />,
    name: '博客面板',
    path: '/blog-dashboard',
  },
  {
    //2级路由
    component: RouteWithSubRouters,
    icon: <UnderlineOutlined/>,
    name: "标签管理",
    path: "/tag",
    routes: [
      {
        //3级路由
        component: RouteWithSubRouters,
        icon: <FontSizeOutlined />,
        name: "标签列表",
        path: "/list",
        routes: [
          {
            path: "/create",
            icon: <BgColorsOutlined />,
            name: "新建标签",
            component: Loadable({
              loader:() => import("../../pages/blog-manage/tag/CreateTag"),
              ...loadings
            }),
          },
          {
            component: Loadable({
              loader:() => import("../../pages/blog-manage/tag"),
              ...loadings
            }),
          },
        ],
      },
    ],
  },
  {
    //2级路由
    component: RouteWithSubRouters,
    icon: <SmallDashOutlined />,
    name: "文章管理",
    path: "/article",
    routes: [
      {
        //3级路由
        component: RouteWithSubRouters,
        icon: <PieChartOutlined />,
        name: "文章列表",
        path: "/list",
        routes: [
          {
            path: "/create",
            icon: <BgColorsOutlined />,
            name: "新建标签",
            component: Loadable({
              loader:() => import("../../pages/blog-manage/tag/CreateTag"),
              ...loadings
            }),
          },
          {
            component: Loadable({
              loader:() => import("../../pages/blog-manage/article"),
              ...loadings
            }),
          }
        ],
      },
    ],
  },
]
export default blog